<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    function SuperType() {
        this.colors = ['red', 'orange', 'yellow', 'green']
    }
    function SubType() {
        // 继承了SuperType
        SuperType.call(this)    // 这里的this就是实例对象
    }
    var instance1 = new SubType()
    instance1.colors.push('cyan')
    var instance2 = new SubType()
    console.log(instance1.colors)   // "red", "orange", "yellow", "green", "cyan"
    console.log(instance2.colors)   // "red", "orange", "yellow", "green"

</script>

</body>
</html>
